Skip to content

fix: consolidate unresolved review feedback from PRs #4, #6, #26#35

Closed
Copilot wants to merge 2 commits intocopilot/add-xmcp-server-interfacefrom
copilot/clear-pending-prs-yet-again
Closed

fix: consolidate unresolved review feedback from PRs #4, #6, #26#35
Copilot wants to merge 2 commits intocopilot/add-xmcp-server-interfacefrom
copilot/clear-pending-prs-yet-again

Conversation

Copy link
Contributor

Copilot AI commented Feb 9, 2026

Addresses all actionable, unresolved review comments across the three substantive open PRs to unblock merging.

xapi.ts — type safety & robustness (PR #26)

  • Replace string-concatenated mentions URL with URLSearchParams; add since_id pagination tracking
  • Add Array.isArray() guard in fetchThread() before parseThread() to handle non-array API responses
  • Type parseThread param as { created_at: string; [key: string]: unknown }[] instead of any[]
  • Use [...tweets].sort() to avoid mutating the input array

agent.ts — memory bounds & correctness (PRs #26, #6)

  • Add MAX_PROCESSED_MENTIONS cap with safe iterator pruning using { value, done } destructuring (no type assertions)
  • Process mentions oldest-first ([...newMentions].reverse()) so Set insertion order matches chronological order
  • Pass mention.post.id as mentionPostId to analyzeAndDecide

grok.ts — reply targeting & type safety (PR #6)

  • Add mentionPostId parameter to analyzeAndDecide so replies target the mention post, not the thread root
  • Replace const data: any with a typed assertion for the Grok API response

index.ts — stdout/stderr separation (PR #26)

  • Redirect console.log to stderr (unknown[], no unused origLog binding) to avoid corrupting MCP stdio transport

README.md (PR #4)

  • Fix broken list numbering in xAI/Grok API key section
// Safe iterator pruning pattern (agent.ts)
const { value, done } = iter.next();
if (done) break;
this.processedMentions.delete(value);

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Add console.log→stderr redirect with unknown[] type (PR #26)
- Use URLSearchParams for mentions URL + since_id pagination (PR #26)
- Add Array.isArray() guard in fetchThread() (PR #26)
- Add Set pruning with safe { value, done } iterator (PR #26)
- Process mentions oldest-first for chronological pruning (PR #26)
- Use [key: string]: unknown in parseThread, spread sort (PR #26)
- Add mentionPostId param for correct reply targeting (PR #6)
- Fix any type in Grok response parsing (PR #6)
- Fix README broken list numbering (PR #4)

Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Copilot AI changed the title [WIP] Review and implement suggestions from pending PRs fix: consolidate unresolved review feedback from PRs #4, #6, #26 Feb 9, 2026
Copilot AI requested a review from groupthinking February 9, 2026 18:24
@groupthinking
Copy link
Owner

Closing stale draft — superseded by cleanup/ready-to-use merge to main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants